MEMS devices are found in a wide range of applications, as diverse as optical scanners, automotive pressure sensors and accelerometers, and gyroscopes used in computing and communication devices. MEMS-based optical scanners are described, for instance, in U.S. Pat. No. 7,952,781 and in U.S. Patent Application Publication 2013/0207970, whose disclosures are incorporated herein by reference.
Methods for monitoring the operation of a scanning mirror are known in the art. For example, U.S. Patent Application Publication 2013/0250387, whose disclosure is incorporated herein by reference, describes a transmitter, which is configured to emit a beam comprising pulses of light, and a scanning mirror, which is configured to scan the beam over a scene. A receiver is configured to receive the light reflected from the scene and to generate an output indicative of the pulses returned from the scene. A grating is formed on an optical surface in the apparatus and is configured to diffract a portion of the beam at a predetermined angle, so as to cause the diffracted portion of the beam to be returned from the scanning mirror to the receiver. A controller is coupled to process the output of the receiver so as to detect the diffracted portion and to monitor a scan of the mirror responsively thereto.